import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/mine',
    name: 'Mine',
    component: () => import('../views/Mine.vue'),
    // props:true,
    children:[
      {
        path:'parent',
        name:'Parent',
        meta: { requiresAuth: true },
        component: () => import('../views/Parent.vue')
      },{
        path: 'topic',
        name: 'Topic',
        component: () => import('../views/Topic.vue'),
        beforeEnter: (to, from, next) => {
          console.log(to);
          console.log(from);
          next()
        }
      },
    ]
  },
]



const router = new VueRouter({
  routes,
})

export default router
